﻿using System.Collections.Generic;
using TMT_CMS.BL.DB;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace TMT_CMS.BL.Model.User
{
    public class UserRoleViewModel
    {
        public int ID { get; set; }
        [Required( ErrorMessage = "用户组名不能为空")]
        [StringLength(50, ErrorMessage = "用户组长度太长")]
        //[Remote("CheckRoleNameExists", "User", ErrorMessage = "用户组名已存在")]
        [Remote("CheckRoleNameExists", "User", AdditionalFields  = "ID",ErrorMessage = "用户组名已存在")]
        public string RoleName { get; set; }
        public List<PermissionEx> Permissions { get; set; }
    }

    public partial class PermissionEx : Permission
    {
        public bool IsChecked { get; set; }
    }

}